package com.fudan.biz.visualize.dao;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import com.fudan.biz.visualize.entity.Setting;
import com.fudan.framework.base.BaseDao;

@Repository
public interface SettingDao extends BaseDao<Setting> {

    @Query(nativeQuery = true, value = "select theme_name from t_setting where theme_status=:themeStatus limit 1")
    public String getThemeName(@Param("themeStatus") Integer themeStatus);
//
//    @Query(nativeQuery = true, value = "insert into t_role_permission(role_id,permission_id) values (:roleId,:permissionId)")
//    @Modifying
//    public Integer insertPermission(@Param("roleId") Integer roleId, @Param("permissionId") String permissionId);
//
//    @Query(nativeQuery = true, value = "delete from t_role_permission where role_id=:roleId")
//    @Modifying
//    public Integer deletePermission(@Param("roleId") Object roleId);
//
//    @Query(nativeQuery = true, value = "select permission_id from t_role_permission where role_id=:roleId")
//    public List<Integer> findPermission(@Param("roleId") Integer roleId);
//
//    @Query(nativeQuery = true, value = "select p.code from t_user u left join t_role r on u.role_id=r.id left join t_role_permission rp on rp.role_id=r.id left join t_permission p on p.id=rp.permission_id where u.id=:userId")
//    public List<String> findPermissionCodeByUserId(@Param("userId") Object userId);
}
